import React, { Component } from 'react';
import { router } from 'umi';
import ProDetail from '@/pages/components/Problem/ProblemPage/ProDetail';

class Proble extends Component {
  onModifyData = data => {
    const {
      location: { pathname },
    } = this.props;
    const tempUrl = pathname.split('/problem')[0];
    router.push(`${tempUrl}/update?insSerHdlId=${data.busiId}`);
  };

  onViewDetails = data => {
    const {
      location: { pathname },
    } = this.props;
    const tempUrl = pathname.split('/problem')[0];
    router.push(`${tempUrl}/detail?insSerHdlId=${data.busiId}`);
  };

  render() {
    return <ProDetail onModifyData={this.onModifyData} onViewDetails={this.onViewDetails} />;
  }
}

export default Proble;
